﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Printing;
using System.Drawing;

namespace MyPhotoIndex.Utilities
{
    public class Printing
    {
        public static bool IsValidPrinterInstalled()
        {
            int numOfPrinters = PrinterSettings.InstalledPrinters.Count;
            if (numOfPrinters == 0)
            {
                return false;
            }

            try
            {
                using (PrintDocument printDoc = new PrintDocument())
                {
                    Rectangle bounds = printDoc.PrinterSettings.DefaultPageSettings.Bounds;
                }
            }
            catch(Exception ex)
            {
                Logger.Log(ex);
                return false;
            }

            return true;
        }
    }
}
